.pageContainer {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.toolbar {
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.container {
  display: flex;
  gap: 24px;
  height: calc(100% - 65px);

  &.edit {
    .editSection {
      flex: 1;
    }

    .previewSection {
      display: none;
    }
  }

  &.preview {
    .editSection {
      display: none;
    }

    .previewSection {
      flex: 1;
    }
  }

  &.split {
    .editSection,
    .previewSection {
      flex: 1;
    }
  }
}

.editSection,
.previewSection {
  overflow: auto;
}

.preview {
  padding: 24px;
  background: #fff;
  border-radius: 8px;

  .previewHeader {
    display: flex;
    align-items: flex-start;
    padding-bottom: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid #f0f0f0;

    .previewAvatar {
      flex-shrink: 0;
      margin-right: 40px;

      img {
        width: 180px;
        height: 180px;
        border-radius: 50%;
        border: 4px solid #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 10%);
      }
    }

    .previewInfo {
      flex: 1;
      padding-top: 12px;

      .nameSection {
        min-height: 120px;
        margin-bottom: 16px;

        h2 {
          font-size: 32px;
          margin-bottom: 12px;
          color: #262626;
          font-weight: 600;
          min-height: 38px;
        }

        .pinyin {
          color: #666;
          font-size: 18px;
          margin-bottom: 8px;
          min-height: 27px;
        }

        .foreignName {
          color: #8c8c8c;
          font-size: 16px;
          margin-bottom: 16px;
          min-height: 24px;
        }
      }

      .tags {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        min-height: 32px;

        :global(.ant-tag) {
          padding: 4px 12px;
          font-size: 14px;
          border-radius: 4px;
        }
      }
    }
  }

  .previewContent {
    .previewSection {
      margin-bottom: 24px;

      &:last-child {
        margin-bottom: 0;
      }

      h3 {
        font-size: 16px;
        color: #1890ff;
        margin-bottom: 16px;
        padding-left: 12px;
        border-left: 3px solid #1890ff;
      }

      p {
        color: #666;
        line-height: 1.8;
      }

      .infoGrid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;

        .infoItem {
          padding: 12px 16px;
          background: #f8f9fa;
          border-radius: 6px;
          transition: all 0.3s ease;

          &:hover {
            background: #f0f2f5;
          }

          .label {
            display: block;
            color: #999;
            font-size: 13px;
            margin-bottom: 4px;
          }

          .value {
            color: #262626;
            font-size: 14px;
          }
        }
      }
    }
  }
}

// 响应式设计
@media (max-width: 768px) {
  .container {
    flex-direction: column;

    &.split {
      .editSection,
      .previewSection {
        flex: none;
      }
    }
  }

  .preview {
    .previewHeader {
      flex-direction: column;
      text-align: center;

      .previewAvatar {
        margin: 0 0 16px;
      }

      .previewInfo {
        .tags {
          justify-content: center;
        }
      }
    }

    .previewContent {
      .previewSection {
        .infoGrid {
          grid-template-columns: repeat(2, 1fr);
        }
      }
    }
  }
}

.avatarContainer {
  display: flex;
  justify-content: center;

  :global {
    .ant-upload {
      position: relative;
      width: 200px !important;
      height: 200px !important;
      margin: 0;
      border-radius: 50% !important;
      overflow: hidden;

      // 修复图片和遮罩层的位置
      .ant-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
      }
    }
  }
}

// 修改遮罩层样式
.avatarMask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  background: rgba(0, 0, 0, 50%);
  opacity: 0;
  transition: opacity 0.3s;

  &:hover {
    opacity: 1;
  }

  .anticon {
    font-size: 24px;
    margin-bottom: 8px;
  }
}

// 上传时的遮罩样式
.uploadMask {
  &:hover {
    opacity: 1 !important;
  }
}

// ���览时的遮罩样式
:global {
  .ant-image-mask {
    &:hover {
      opacity: 1;
    }

    .ant-image-mask-info {
      .anticon {
        font-size: 24px;
        margin-right: 8px;
      }
    }
  }
}

.avatarWrapper {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
}

.uploadButton {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #fafafa;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;

  &:hover {
    .uploadOverlay {
      background: rgba(0, 0, 0, 50%);
    }
  }
}

.uploadOverlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 30%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  transition: background 0.3s ease;

  .anticon {
    font-size: 32px;
    margin-bottom: 8px;
  }
}

// 动态表单项样式
.extraFields {
  margin-bottom: 24px;

  .extraFieldsTitle {
    font-size: 16px;
    margin-bottom: 16px;
    color: rgba(0, 0, 0, 85%);
  }
}

.extraField {
  margin-bottom: 16px;
  padding: 16px;
  background: #fafafa;
  border-radius: 4px;

  &:hover {
    background: #f0f0f0;
  }
}

// 修改预览区域卡片样式
.previewSection {
  &:global(.ant-card):not(:has(.ant-card-head)) {
    background: #f5f7fa;

    :global(.ant-card-body) {
      padding: 24px;
    }
  }
}
